/* 
@  前端pure-admin 后端node.js
*/
const express = require('express')
const app = express()
const port = 9066
app.use(express.json())
const cors = require('cors')
const { varifyToken } = require('./jwt/index')
app.use(cors())
/*
添加路由 
 */

/* 
开放静态
*/
app.use(express.static(__dirname + '/upload'))



const login = require('./login/index')
const home = require('./home/index')
const test = require('./table-model/index')
app.use(login)
app.use(test)
app.use('/home', (req, res, next) => {
    varifyToken(req, res, next)
})
app.use(home)







app.listen(port, () => {
    console.log('wangs-model-backend is running now')
})